<template>
    <div class="dropdown_index">
        <div class="tabs">
            <div class="tab_item" v-for="(key, index) in Object.keys(data.childer)" :key="key" 
                :class="data.activetab == key ? 'tab_item_active' : ''"
                @click="data.activetab = key">{{ data.childer[key].header_name }}
            </div>
        </div>
        <div class="content">
            <el-scrollbar height="100%">
                <el-row style="padding: 16px 24px;">
                    <el-col :span="6" v-for="(key, index) in Object.keys(data.childer[data.activetab].pk_list)" :key="key" style="margin: 8px 0;">
                        <el-radio-group v-model="data.activevalue" @change="changeactive(key,data.childer[data.activetab].pk_list[key])">
                            <el-radio :value="key">
                                <div class="radio_label">
                                    <div style="color: #000;">{{key,data.childer[data.activetab].pk_list[key]}}</div>
                                </div>
                            </el-radio>
                        </el-radio-group>
                    </el-col>
                </el-row>
            </el-scrollbar>
        </div>
    </div>
</template>

<script setup>
const { monitorStore, monitorState } = inject('MonitorStore')

const props = defineProps({
    typekey: String,
    data: Object
})

const changeactive = (key,value) => {
    props.data.activevalue = key
    props.data.activelabel = value
    console.log(props.data);
    
    monitorStore.getpicturedata(true)
}
</script>

<style lang="scss" scoped>
.dropdown_index {
    width: 480px;
    height: 290px;
    display: flex;
    flex-direction: column;
}

.tabs {
    height: 40px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #ebebeb;

    .tab_item {
        border-bottom: 2px solid #fff;
        margin-right: 24px;
        font-size: 14px;
        color: #000;
        height: calc(100% - 2px);
        display: flex;
        align-items: center;
        cursor: pointer;

    }

    .tab_item_active {
        border-bottom: 2px solid #e92937;
        font-size: 14px;
        font-weight: 600;
        color: #e92937;

    }
}

.content {
    height: calc(100% - 40px);
    
}

.radio_label{
    display: flex;
    align-items: center;
    font-size: 14px;
}
</style>

<style>
.dropdown_index .el-radio__input.is-checked .el-radio__inner{
    border-color: #e92937;
    background: #e92937;
}



</style>